import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:flutter/material.dart';

class NormalResetTextButton = NormalTextButton with _ResetButtonMixin;

mixin _ResetButtonMixin {
  final String text = S.current.reset;
}

class NormalDeleteTextButton = NormalTextButton with _DeleteButtonMixin;

mixin _DeleteButtonMixin {
  final String text = S.current.delete;
}

class NormalDoneTextButton = NormalTextButton with _DoneButtonMixin;

mixin _DoneButtonMixin {
  final String text = S.current.done;
}

class NormalNextTextButton = NormalTextButton with _NextButtonMixin;

mixin _NextButtonMixin {
  final String text = S.current.next;
}

class NormalSaveTextButton = NormalTextButton with _SaveButtonMixin;

mixin _SaveButtonMixin {
  final String text = S.current.save;
}

class NormalConfirmTextButton = NormalTextButton with _ConfirmButtonMixin;

mixin _ConfirmButtonMixin {
  final String text = S.current.confirm;
}

class NormalTextButton extends StatelessWidget {
  final VoidCallback onTap;

  NormalTextButton({Key key, this.onTap}) : super(key: key);

  String get text => '';

  @override
  Widget build(BuildContext context) {
    return PressedOpacityButton(
      onPressed: onTap,
      padding: EdgeInsets.symmetric(
        horizontal: getDp(15),
      ),
      child: Text(
        text,
        style: TextStyle(
          color: Colors.white,
          fontSize: getSp(18),
          fontWeight: FontWeight.w700,
          height: 42 / 18,
        ),
      ),
    );
  }
}
